<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    //
    var obj = {
      name: "小李",
      age: 18,
      1.8: "哈哈哈",
      run: function () { }
    }
    obj.run()
    console.log(obj.name)
    console.log(obj["name"])
    var myage = "age"
    // key值是变量时候 必须用obj[变量]
    // console.log(obj.myage) 
    console.log(obj[myage])
    // 当key 是数字类型 用obj[1.8]
    console.log(obj[1.8])
    // 
    var obj = {
      name: 1,
      age: 2,
      sex: ["男", "女"]
    }
    var myobj = obj; // 只是把堆内存的地址进行赋值 俩个变量公用一份堆内存
    console.log(myobj)
    myobj.age = 88;
    console.log(myobj.age)
    console.log(obj.age)
    // 栈内存 存储基本数据类型和堆内存的地址
    // 堆内存 存储引用数据类型



  </script>
</body>

</html>